<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>HR医院 - 部门列表</title>
	<meta name="keywords" content="">
	<meta name="description" content="">

	<link rel="shortcut icon" href="favicon.ico">
	<link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

	<!-- Data Tables -->
	<link href="css/plugins/dataTables/dataTables.bootstrap.css"
		rel="stylesheet">
	<link href="css/animate.css" rel="stylesheet">
	<link href="css/style.css?v=4.1.0" rel="stylesheet">

</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>部门列表</h5>
					</div>
					<div class="ibox-content">
						<div>
							<a href="/toAddDeptment" class="btn btn-success">添加部门</a>
						</div>
						<table class="table table-striped table-bordered table-hover dataTables-example">
							<thead>
								<tr>
									<th>序号</th>
									<th>部门号</th>
									<th>部门名称</th>
									<th>电话</th>
									<th>地址</th>
									<th width="180px">备注</th>
									<th>管理</th>
								</tr>
							</thead>
							<tbody>
							<!--以下代码需修改 -->
								<tr class="gradeA" th:each="dept:${depts}" >
									<td th:text="${dept.id*dept.id}">id</td>
									<td th:text="${dept.department_number}"></td>
									<td th:text="${dept.name}"></td>
									<td th:text="${dept.telephone}"></td>
									<td th:text="${dept.address}"></td>
									<td th:text="${dept.notes}"></td>
									<td><a th:href="@{'/toUpdateDept?id='+${dept.id}}" class="btn btn-primary">修改</a>&nbsp;&nbsp;
<!--										<a  th:href="@{'/toUpdateDept?id='+${dept.id}}">修改</a>-->
<!--										<a  th:href="@{'/toDeteleDept?id='+${dept.id}}" class="ddel">删除</a>-->
										<a th:href="@{'/toDeteleDept?id='+${dept.id}}" class="btn btn-danger ddel">删除</a></td>
								</tr>
							<!--以上代码需修改 -->
							</tbody>
						</table>
						
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 全局js -->
	<script src="js/jquery.min.js?v=2.1.4"></script>
	<script src="js/bootstrap.min.js?v=3.3.6"></script>
	<script src="js/plugins/jeditable/jquery.jeditable.js"></script>

	<!-- Data Tables -->
	<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>

	<!-- 自定义js -->
	<script src="js/content.js?v=1.0.0"></script>
	<script src="./jquery.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function (){
			function delDept(id){
				var flag = confirm("确认删除部门吗")
				if(flag){
					var deptid = id;//要删的部门id
					// location.href="/delDept?id="+deptid
				}else {
					return false
				}

			}
			$(".ddel").click(function (){
				var flag = confirm("确认删除部门吗")
				if(flag) {
					var href = $(this).attr("href")
					$("[name=did]").val(href);
					$("form").submit()
					return true
				}else
					return false
			})
		})
	</script>
</body>
</html>